<!DOCTYPE html>
<html>
<head>
<title>Weiran ECMAScript Applications Framework</title>
<link rel=stylesheet type=text/css href=./style.css>
</head>

<body>

<div class=leftbar>
    <h1>Weiran</h1>
    <p>ECMAScript<br />Applications Framework</p>
    <p>Version: 1.2</p>
    <ul>
	<li>Weiran<ul>
	    <li><a href=#Weiran.VERSION_NUMBER>Weiran.VERSION_NUMBER</a></li>
	    <li><a href=#Weiran.IS_GECKO>Weiran.IS_GECKO</a></li>
	    <li><a href=#Weiran.BROWSER_NAME>Weiran.BROWSER_NAME</a></li>
	    <li><a href=#Weiran.createUniqueID>Weiran.createUniqueID</a></li>
	    <li><a href=#Weiran.getScriptLocation>Weiran.getScriptLocation</a></li>
	    <li><a href=#Weiran.getElement>Weiran.getElement</a></li>
	    <li><a href=#Weiran.getStyle>Weiran.getStyle</a></li>
	    <li><a href=#Weiran.getViewportElement>Weiran.getViewportElement</a></li>
	    <li><a href=#Weiran.pagePosition>Weiran.pagePosition</a></li>
	    <li><a href=#Weiran.extend>Weiran.extend</a></li>
	    <li><a href=#Weiran.applyDefaults>Weiran.applyDefaults</a></li>
	    <li><a href=#Weiran.md5>Weiran.md5</a></li>
	</ul></li>
	<li><a href=Weiran.Array.html>Weiran.Array</a></li>
	<li><a href=Weiran.Buffer.html>Weiran.Buffer</a></li>
	<li><a href=Weiran.Class.html>Weiran.Class</a></li>
	<li><a href=Weiran.Date.html>Weiran.Date</a></li>
	<li><a href=Weiran.DB.html>Weiran.DB</a></li>
	<li><a href=Weiran.Event.html>Weiran.Event</a></li>
	<li><a href=Weiran.Events.html>Weiran.Events</a></li>
	<li><a href=Weiran.Function.html>Weiran.Function</a></li>
	<li><a href=Weiran.JSON.html>Weiran.JSON</a></li>
	<li><a href=Weiran.Lang.html>Weiran.Lang</a></li>
	<li><a href=Weiran.Number.html>Weiran.Number</a></li>
	<li><a href=Weiran.String.html>Weiran.String</a></li>
	<li><a href=Weiran.GRUB.html>GRUB Mechanism</a></li>
    </ul>
    <p>
        Copyright &copy; All<span>i</span>dylls<br />
        2011 - 2012
    </p>
</div>

<div class=content>

<div class=reftitle>Weiran</div>
<p>Global namespace contains all constants, properties, methods, namespaces and classes.</p>

<a name=Weiran.VERSION_NUMBER></a>
<h3><code>Weiran.VERSION_NUMBER</code></h3>
<p><b>Constant: </b><code>string</code></p>
<p>The version number string of <code>Weiran</code>.</p>

<a name=Weiran.IS_GECKO></a>
<h3><code>Weiran.IS_GECKO</code></h3>
<p><b>Constant: </b><code>boolean</code></p>
<p>True if the userAgent reports the browser to use the Gecko engine.</p>

<a name=Weiran.BROWSER_NAME></a>
<h3><code>Weiran.BROWSER_NAME</code></h3>
<p><b>Constant: </b><code>string</code></p>
<p>A substring of the <code>navigator.userAgent</code> property.
    Depending on the userAgent property, this will be the empty string or one of the following:
    <ul>
	    <li>"opera" as Opera</li>
	    <li>"msie" as Internet Explorer</li>
	    <li>"safari" as Safari</li>
	    <li>"firefox" as Firefox</li>
	    <li>"mozilla" as Mozilla</li>
	</ul>
</p>

<a name=Weiran.createUniqueID></a>
<h3><code>Weiran.createUniqueID(prefix)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters: </b><br />
    <span class=parameters>prefix</span> - <code>string</code>, prefix of the id, defaults to "weID_"
</p>
<p><b>Returns: </b><code>string</code></p>
<p>Create a unique identifier for this session.  
	        Each time this function is called, a counter is incremented. The return will be the optional prefix 
	        (defaults to "weID_") appended with the counter value.</p>

<a name=Weiran.getScriptLocation></a>
<h3><code>Weiran.getScriptLocation(file, doc)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters: </b><br />
    <span class=parameters>file</span> - <code>string</code>, script file name, defaults to the file which contains this function<br />
    <span class=parameters>doc</span> - <code>document</code>, context document, defaults to current document
</p>
<p><b>Returns: </b><code>string</code></p>
<p>Returns the script file location. The doc is a context document. 
    If file not set, returns the location of <code>Weiran</code> script file.</p>

<a name=Weiran.getElement></a>
<h3><code>Weiran.getElement(args)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters: </b><br />
    <span class=parameters>args</span> - <code>string | array | DOMElement</code>
</p>
<p><b>Returns: </b><code>DOMElement | array</code></p>
<p>Returns DOMElement(s) of given id(s), DOMElement(s), or the global <code>window</code> object.</p>

<a name=Weiran.getStyle></a>
<h3><code>Weiran.getStyle(element, style)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters: </b><br />
    <span class=parameters>element</span> - <code>string | DOMElement</code>, element id or element object<br />
    <span class=parameters>style</span> - <code>string</code>, style name
</p>
<p><b>Returns: </b><code>string</code></p>
<p>Returns the style value of an element.</p>

<a name=Weiran.getViewportElement></a>
<h3><code>Weiran.getViewportElement()</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters: </b>
</p>
<p><b>Returns: </b><code>DOMElement</code></p>
<p>Returns die viewport element of the document. The viewport element is
            usually <code>document.documentElement</code>, except in IE, where it is either
            <code>document.body</code> or <code>document.documentElement</code>, depending on the document's
            compatibility mode (see
            <a target=_blank href=http://code.google.com/p/doctype/wiki/ArticleClientViewportElement>
            http://code.google.com/p/doctype/wiki/ArticleClientViewportElement</a>).</p>

<a name=Weiran.pagePosition></a>
<h3><code>Weiran.pagePosition()</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters: </b>
</p>
<p><b>Returns: </b><code>array</code></p>
<p>Calculates the position of an element on the page.
		    Returns a two item array, Left value then Top value.
		    (see <a target=_blank href=http://code.google.com/p/doctype/wiki/ArticlePageOffset>
		    http://code.google.com/p/doctype/wiki/ArticlePageOffset</a>)</p>

<a name=Weiran.extend></a>
<h3><code>Weiran.extend(dest, source)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters: </b><br />
    <span class=parameters>dest</span> - <code>object</code>, destination object<br />
    <span class=parameters>source</span> - <code>object</code>, source object
</p>
<p><b>Returns: </b><code>object</code></p>
<p>Copy all properties of a source object to a destination object. 
		    Modifies the passed in destination object. 
		    Any properties on the source object that are set to undefined will not be (re)set on the destination object.
		    Returns the destination object.</p>

<a name=Weiran.applyDefaults></a>
<h3><code>Weiran.applyDefaults(to, from)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters: </b><br />
    <span class=parameters>to</span> - <code>object</code><br />
    <span class=parameters>from</span> - <code>object</code>
</p>
<p><b>Returns: </b><code>object</code></p>
<p>Takes an object and copies any properties that don't exist from another properties, 
		    by analogy with <code>Weiran.extend</code>. Returns a reference to the to object.
		    Note that the to argument is modified in place and returned by this function.</p>
		    
<a name=Weiran.md5></a>
<h3><code>Weiran.md5(value, key)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters: </b><br />
    <span class=parameters>value</span> - <code>string</code><br />
    <span class=parameters>key</span> - <code>string</code>, optional
</p>
<p><b>Returns: </b><code>string</code></p>
<p>Calculate the hex-encoded MD5 hash of a given string value.
    If the optional key set, calculate the hex-encoded HMAC-MD5 hash of a given string value and key.</p>

</div>

</body>
</html>
